//
//  ReputationView.m
//  HxgProject
//
//  Created by hxg on 2018/3/13.
//  Copyright © 2018年 XMYY-19. All rights reserved.
//

#import "ReputationView.h"
#import "Masonry.h"

@implementation ReputationView


-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        [self setUpUI];
    }
    return self;
}

- (void)setUpUI
{
    [self addSubview:self.accountLbl];
    [self addSubview:self.accountField];

    [self addSubview:self.psdLbl];
    [self addSubview:self.psdField];
    
    [self addSubview:self.submitBtn];
    [self.accountLbl makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(20.0f);
        make.top.equalTo(self.mas_top).offset(20.0f);
    }];
    
    [self.accountField makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.accountLbl.mas_right).offset(10.0f);
        make.centerY.equalTo(self.accountLbl.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(kScreen_Width/2.0f, 20.0f));
    }];
    
    [self.psdLbl makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(20.0f);
        make.top.equalTo(self.accountLbl.mas_bottom).offset(20.0f);
    }];
    [self.psdField makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.psdLbl.mas_right).offset(10.0f);
        make.centerY.equalTo(self.psdLbl.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(kScreen_Width/2.0f, 20.0f));
    }];
    
    [self.submitBtn makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.mas_left).offset(20.0f);
        make.top.equalTo(self.psdField.mas_bottom).offset(20.0f);
        make.size.mas_equalTo(CGSizeMake(kScreen_Width/2.0f, 25.0f));
    }];
}

-(UILabel *)accountLbl
{
    if (!_accountLbl)
    {
        _accountLbl = [[UILabel alloc] init];
    }
    return _accountLbl;
}


- (UITextField *)accountField
{
    if (!_accountField)
    {
        _accountField = [[UITextField alloc] init];
    }
    return _accountField;
}

-(UILabel *)psdLbl
{
    if (!_psdLbl)
    {
        _psdLbl = [[UILabel alloc] init];
    }
    return _psdLbl;
}


- (UITextField *)psdField
{
    if (!_psdField)
    {
        _psdField = [[UITextField alloc] init];
    }
    return _psdField;
}

-(UIButton *)submitBtn
{
    if (!_submitBtn) {
        _submitBtn = [[UIButton alloc] init];
    }
    return _submitBtn;
}

@end
